//
//  NSString+Helper.h
//  02.用户登录&注册
//
//  Created by 刘凡 on 13-11-28.
//  Copyright (c) 2013年 itcast. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Helper)
/**
 *  从data转化后的token
 *
 *  @return token
 */
+ (NSString *)replaceUnicode:(NSString *)unicodeStr ;
+(NSString *)gethexBybin:(NSString *)BIN;
+(NSString *)getBinaryByhex:(NSString *)hex withlength:(NSUInteger)length
;
+ (NSString *)convertDataToHexStr:(NSData *)data;
+(NSData *)convertHexStrToData:(NSString *)str;
+(NSString *)hexStringFromString:(NSString *)string;
- (NSString *)stringFromHexString ;
-(NSInteger )intFromHexString;
-(NSString *)token;
+(NSString *)getSign:(NSDictionary *)parmars;
+ (NSString *)getDeviceSSID;
/**
 *  清空字符串中的空白字符
 *
 *  @return 清空空白字符串之后的字符串
 */
- (NSString *)trimString;

/**
 *  是否空字符串
 *
 *  @return 如果字符串为nil或者长度为0返回YES
 */
- (BOOL)isEmptyString;

/**
 *  返回沙盒中的文件路径
 *
 *  @return 返回当前字符串对应在沙盒中的完整文件路径
 */
- (NSString *)documentsPath;

/**
 *  写入系统偏好
 *
 *  @param key 写入键值
 */
- (void)saveToNSDefaultsWithKey:(NSString *)key;
+(NSString *)getNetWorkStates;
- (BOOL)isMobileNumber;
/**
 *  是否为合法的密码
 */
- (BOOL)isRegexPassword;


/**
 *  获取当前时间
 */
+ (NSString *)getCurrentTime:(NSString *)timeFormat;

/**
 *  根据时间戳获取时间
 */
+ (NSString *)getTimeWithTimestamp:(NSString *)stamp format:(NSString *)dateFormat;

/**
 *  根据16进制字符串获取时间字符串
 */
+ (NSString *)timeFromHexString:(NSString *)hexString;

+ (BOOL)isContainsTwoEmoji:(NSString *)string;

- (BOOL)isNumberString;
@end
